package com.ntschy.bt.service.IBtHelp.impl;

import com.ntschy.bt.entity.dataobject.BtHelp.BtHelp;
import com.ntschy.bt.mapper.BtHelpAssignMapper;
import com.ntschy.bt.mapper.BtHelpReviewMapper;
import com.ntschy.bt.service.IBtHelp.IBtHelpReviewService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class BtHelpReviewServiceImpl implements IBtHelpReviewService {

    @Resource
    private BtHelpReviewMapper btHelpReviewMapper;


    // * ================================================基础增删改查BEGIN============================================= *

    /**
     * 分页查询
     * 当前查询条件：根据企业名称｜企业分类 | 求助类型 | 提交时间 | 状态 时间倒序
     * @param btHelp 分页查询对象
     * @return 分页列表
     */
    @Override
    public List<BtHelp> pageHelpReview(BtHelp btHelp) {
        List<BtHelp> btHelps = btHelpReviewMapper.pageHelpReview(btHelp);
        return btHelps;
    }


    /**
     * 分配部门
     *
     * @param  btHelp
     * @return 修改结果
     */
    @Override
    public int updateAudit(BtHelp btHelp) {
        return btHelpReviewMapper.updateAudit(btHelp);
    }




    // * ================================================基础增删改查BEGIN============================================= *

    /**
     * 插入时间
     * @return
     */
    @Override
    public String newData() {
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String datestring = simpleDateFormat.format(date);
        return datestring;
    }
}
